<!DOCTYPE html>
<html>
	<head>
		<meta charset="{CHARSET}">
		<title></title>
		<link href="bootstrap.min.css" rel="stylesheet">
	   <script src="jquery-3.3.1.min.js"></script>
	   <script src="bootstrap.min.js"></script>
	</head>
	<body>
	<div>
	<button type="button" onclick="myobj()" >解析</button>
	</div>
	<div id="result">结果</div>
	</body>
	<script>
	
			var obj = [{
        name: "p1",
        src: "images/p1.jpg"
    }, {
        name: "p2",
        src: "images/p2.jpg"
    }, {
        name: "p3",
        src: "images/p3.jpg"
    }, {
        name: "p4",
        src: "images/p4.jpg"
    }, {
        name: "p5",
        src: "images/p5.jpg"
    }
]

			function myobj(){ 
			var obj = [{
        name: "p1",
        src: "images/p1.jpg"
    }, {
        name: "p2",
        src: "images/p2.jpg"
    }, {
        name: "p3",
        src: "images/p3.jpg"
    }, {
        name: "p4",
        src: "images/p4.jpg"
    }, {
        name: "p5",
        src: "images/p5.jpg"
    }
]
for(var i=0;i<obj.length;i++){
 $("#result").append("</br>姓名:"+obj[i].name+"路径："+obj[i].src+"</br>");
}
        
		}
	</script>
</html>



